import request from '@/utils/http'

export function getCategoryAPI(id){
  return request({
    url:'/category',
    params: {
      id
    }
  })
}

/**
 * @description: 获取二级分类的列表数据
 * @param {*} id 分类id
 * @returns
 */
export const getCategoryFilterAPI = (id) =>{
  return request ({
    url: '/category/sub/filter',
    params: {
      id
    }
  })
}


/**
 * @description: 获取二类分类的数据
 * @param {*} data {
 *  categoryId:,
 *  page: 1,
 *  pageSize: 20,
 *  sortField: 'publishTime' | 'orderNum' | 'evaluateNum'
 * }
 * @returns
 */
export const getSubCategoryAPI = (data) =>{
  return request({
    url: '/category/goods/temporary',
    method: 'POST',
    data
  })
}
